/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package treenode.visitor;

/**
 *
 * @author Bartek
 */
public class InFixPrintVisitor extends Visitor {
    
    @Override
    public void visitBinaryOperatorNode(BinaryOperatorNode node) {
        System.out.print("(");
        node.getLeft().accept(this);
        System.out.print(node.getLabel());
        node.getRight().accept(this);
        System.out.print(")");
    }
    
    @Override
    public void visitNumericNode(NumericNode node) {
        System.out.print(node.getLabel());
    }
}
